package xyz.yolin.utils;

public class lianshi {
    public static void main(String[] args) {
        System.out.println(mytool.getInstance().setName("张金").setAge(23).setGrade("大三"));
    }
}

class mytool{
    private Student stu=new Student();

    private mytool() {
    }
    public static mytool getInstance(){
        return new mytool();
    }
    public mytool setName(String name){
        stu.setName(name);
        return this;
    }
    public mytool setAge(int i){
        stu.setAge(i);
        return this;
    }
    public mytool setGrade(String grade){
        stu.setGrade(grade);
        return this;
    }

    @Override
    public String toString() {
        return "mytool{" +
                "stu=" + stu +
                '}';
    }
}